package com.An.service;

import com.An.pojo.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @auther AnYang
 * @date 2022/3/22 20:00
 **/
public interface AdminService {
	/*根据学号查询学生*/
	Student getStudentBySno(Integer sno);

	//根据学号查询住寝室学生
	StudentDorm getStuDormBySno(Integer sno);

	//根据寝室和床位查询学生
	StudentDorm getStuByDormAndBedId(Integer dorm_id, Integer bed_id);

	//查询申请学生
	StudentApplication getStuApplicationBySno(Integer sno);

	//走读申请的学生
	List<StudentApplication> getStudentApplication();

	//换寝
	List<StudentApplication> getStuApplyUpDorm();

	/*插入新的学生*/
	Boolean insertStudent(Student student);

	Boolean insertStudentSimply(Student student);

	//在班级教师表中插入新的教师教学记录
	Boolean insertClassTeacher(ClassTeacher classTeacher);

	/*删除自定学生*/
	Boolean deleteStudentBySno(Integer sno);

	//删除教职表中的数据
	Boolean deleteClassTeacher(Integer classid, Integer tid, String subject);

	//删除住校学生
	Boolean deleteStuDormBySno(Integer sno);

	//删除学生请假理由
	Boolean deleteStuApplyBySno(Integer sno);

	//删除学生更换寝室的记录
	Boolean deleteStuApplication(Integer sno);

	/*更新学生*/
	Boolean updateStudentBySno(Student student, Integer id);

	/*更新老师*/
	Boolean updateTeacher(Teacher teacher, Integer id);

	//修改老师教学班级
	Boolean updateTeacherByStatus(Integer tid, Integer status);

	//更新学生寝室信息
	Boolean updateStuDorm(StudentDorm studentDorm, Integer id);

	//修改教师任职表
	Boolean updateClassTeacher(ClassTeacher classTeacher, Integer tid, Integer classid);

	//修改班主任
	Boolean updateClassGuardian(Integer classid, String guardian);

	//修改班级课表
	Boolean updateClassCourse(@Param("classCourse") ClassCourse classCourse, @Param("classid") Integer classid, @Param("day_id") Integer day_id, @Param("lesson_id") Integer lesson_id);

	/*获取所有班级*/
	List<ClassInfo> getClassInfo();

	/*查询班级学生*/
	List<StudentClass> getStudentByClassId(Integer classid);

	//展示申请住校的学生
	List<StudentDorm> getStudentByDormIdIsNull();

	//展示一个寝室的人
	List<StudentDorm> getStudentDormById(Integer dorm_id);

	//展示住校学生
	List<StudentDorm> getStudentDorm();

	//展示申请走读的学生
	List<StudentDorm> getQuitStuDorm();

	/*根据班级名查询班级*/
	ClassInfo getClassByName(String class_name);

	//根据id查询班级
	ClassInfo getClassById(Integer classid);

	//按班级任职老师查询老师信息
	List<Teacher> getTeacherListByClassId(Integer classid);

	/*根据班级查询教师*/
	List<Teacher> getTeacherByClass(String class_name);

	/*根据班级查询班级学生*/
	List<Student> getStudentByClassName(String class_name);

	/*查询班级老师*/
	List<ClassTeacher> getTeacherByClassId(Integer classid);/*注意mybatis-plus将下划线自动转驼峰*/

	//获取所有班级教师任职情况
	List<ClassTeacher> getAllClassTeacher();

	//根据班级查询教师任职情况
	List<ClassTeacher> getClassTeacherByClass(@Param("classid") Integer classid);

	//根据班级查询该班级的课程是否有老师在上课
	ClassTeacher getClassTeacherByClassSubject(String className, String subject);

	//通过主键获取教师任职记录
	ClassTeacher getClassTeacherById(Integer tid, Integer classid, String subject);

	//获得所有老师。
	List<Teacher> getAllTeacher();

	/*新增一个老师*/
	Boolean insertTeacher(Teacher teacher);

	//删除教师
	Boolean deleteTeacher(Integer tid);

	//查询某班级某门课程是否有老师上课
	Teacher getTeacherByClassSubject(String className, String subject);

	//根据教师编号查询教师
	Teacher getTeacherById(Integer tid);

	/*分页查询*/
	Page<StudentClass> getPage(int currentPage, int pageSize);

	//获得所有课程
	List<Course> getAllCourse();

	//根据课程名查询课程详情
	Course getCourseByName(String cname);

	//根据id查询课程
	Course getCourseById(Integer cid);

	//按照班级课程查找授课老师
	CourseArrange getCourseArrangeByClassSubject(Integer classid, String subject, Integer day_id);

	//修改课程安排
	Boolean updateCourseArrange(Integer sign, Integer id);

	//根据id查数据
	Dormitory getDormById(Integer dorm_id);

	//获得所有寝室信息
	List<Dormitory> getAllDorm();

	//根据性别查询寝室
	List<Dormitory> getDormByGender(String dorm_gender);

	//获得一周的每一天
	List<Week> getWeeKList();

	//获得每一天的课程
	List<Lesson> getLessonList();

	//根据班级获取课程详情
	List<CourseArrange> getListCourseArrangeByClass(Integer classid, Integer day_id);

	//根据班级和日期获得当天的课程信息
	List<ClassCourse> getClassCourseByClass(Integer classid, Integer day_id);

	//查询所有的考试信息
	List<Exam> getExamList();

	//查询所有的考试时间
	List<ExamDuration> getExamDurationList();

	//根据考试查询具体考试科目
	List<ExamSubject> getExamSubjectByExamId(Integer exam_id);

	//查询考试
	Exam getExamById(Integer exam_id);

	//查询具体考场
	ExamInfo getExamInfoById(Integer exam_id, Integer exam_cid, String exam_place);

	//按id查考场
	ExamInfo getExamInfo(Integer id);

	//查询具体的考试科目
	ExamSubject getExamSubject(Integer exam_id, Integer exam_cid);

	//查询考生信息
	StudentExam getStuExamInfo(Integer exam_id, Integer exam_cid, Integer sno);

	//查询考试科目信息
	List<ExamInfo> getExamInfoList(Integer exam_id, Integer exam_cid);

	//按班级查询学生
	List<StudentExam> getExamInfoByClass(Integer exam_id, Integer exam_cid, Integer classid);

	//按考试查询信息
	List<StudentExam> getExamInfoByExamId(Integer exam_id, Integer exam_cid);

	//查询个人考试信息
	List<StudentExam> getStuExamSelf(Integer exam_id, Integer sno);

	//这次考试的所有的考场信息
	List<ExamInfo> getExamInfoListById(Integer exam_id);

	//添加学生成绩
	Boolean updateStuGrade(Integer exam_id, Integer exam_cid, Integer sno, Integer grade);

	//清空考场
	Boolean updateClearStuExamPlace(Integer exam_cid);

	//确定考试时间
	Boolean updateExamInfo(Integer exam_id, Integer cid, String exam_date, String exam_time);

	//确定考生的考试时间
	Boolean updateStuExam(@Param("exam_id") Integer exam_id, @Param("exam_cid") Integer cid, @Param("exam_date") String exam_date, @Param("exam_time") String exam_time);

	Boolean updateStuExamPlace(@Param("exam_id") Integer exam_id, @Param("sno") Integer sno, @Param("exam_place") String exam_place, @Param("seat_num") Integer seat_num);

	//确定监考官
	Boolean updateExamTeacher(@Param("id") Integer id, @Param("tid_first") Integer tid_first, @Param("tid_second") Integer tid_second, @Param("tname_first") String tname_first, @Param("tname_second") String tname_second);

	//查询日期
	Week queryDateById(Integer day_id);

	//根据班级,星期,节次,查询具体的某一节课
	ClassCourse getClassCourseById(Integer classid, Integer day_id, Integer lesson_id);

	//根据时间和老师来查询课程
	ClassCourse getClassCourseByTid(Integer tid, Integer day_id, Integer lesson_id);


}